﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace RW.Parser
{
    public static class StringExtensions
    {
        public static string[] SplitAndTrim(this string s, char[] separators, StringSplitOptions options)
        {
            string[] split = s.Split(separators, options);
            return split.Select(ss => ss.Trim()).ToArray();
        }

        public static string[] SplitAndTrim(this string s, string[] separators, StringSplitOptions options)
        {
            string[] split = s.Split(separators, options);
            return split.Select(ss => ss.Trim()).ToArray();
        }

        public static void AppendLine(this TextBox textBox, string text)
        {
            textBox.AppendText(String.Format("{0}{1}", text, Environment.NewLine));
        }
    }
}
